//---------------------------------------------------------------------
//  This file is part of the Background Motion solution.
// 
//  Copyright (C) Mindscape (TM).  All rights reserved.
//  http://www.mindscape.co.nz
// 
//  THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
//  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
//  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//  PARTICULAR PURPOSE.
//---------------------------------------------------------------------

using Microsoft.Practices.CompositeWeb;

namespace Mindscape.BackgroundMotion.Website.Infrastructure
{
  /// <summary>
  /// The base class for all presenters in the system
  /// </summary>
  /// <typeparam name="TView">The view contract which the presenter will be working with</typeparam>
  /// <typeparam name="TController">The type of application controller which the presenter will be working with</typeparam>
  public class PresenterBase<TView, TController> : Presenter<TView>
  {
    private TController _controller;
    private IReferenceDataProvider _referenceDataProvider;

    /// <summary>
    /// The current application controller instance we are working with
    /// </summary>
    /// <remarks>
    /// The ServiceDependancy attribute indicates a dependancy which will be satified by the dependancy injection framework
    /// </remarks>
    /// <value>The controller.</value>
    [ServiceDependency]
    public TController Controller
    {
      get { return _controller; }
      set { _controller = value; }
    }

    /// <summary>
    /// The current reference data provider
    /// </summary>
    /// <remarks>
    /// The ServiceDependancy attribute indicates a dependancy which will be satified by the dependancy injection framework
    /// </remarks>
    [ServiceDependency]
    public IReferenceDataProvider ReferenceDataProvider
    {
      get { return _referenceDataProvider; }
      set { _referenceDataProvider = value; }
    }
  }
}